package net.m510.autosurfer.common;

import java.io.File;
import java.net.URI;

import net.m510.autosurfer.core.FileResponseHandler;
import net.m510.autosurfer.core.process.AbstractGetProcess;

import org.apache.http.client.ResponseHandler;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.impl.client.CloseableHttpClient;
import org.jsoup.nodes.Document;

public class FileGetProcess extends AbstractGetProcess<File> {
	private File file;
	private URI uri;
	private ResponseHandler<File> handler;
	
	public FileGetProcess(CloseableHttpClient client,HttpClientContext context,File file, URI uri) {
		super(client, context);
		this.file = file;
		this.uri = uri;
		this.handler = new FileResponseHandler(file);
	}

	@Override
	protected ResponseHandler<File> getResponseHandler() {
		return handler;
	}

	@Override
	protected URI getUri(Document doc) {
		return uri;
	}

	public File getFile() {
		return file;
	}

	public URI getUri() {
		return uri;
	}
}
